//
//  ALHomeTitleButton.swift
//  ALSinaWeiBoSwift
//
//  Created by 柴瑞军 on 16/4/13.
//  Copyright © 2016年 myCompany. All rights reserved.
//

import UIKit

class ALHomeTitleButton: UIButton {

    init(title:String){
        super.init(frame:CGRectZero)
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.blackColor(), forState: UIControlState.Normal)
        
        self.setImage(UIImage(named: "navigationbar_arrow_down"), forState: UIControlState.Normal)
        sizeToFit()
        
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
//    重新布局控件
    override func layoutSubviews() {
        super.layoutSubviews()
        
        titleLabel?.frame.origin.x = 0
        
        imageView?.frame.origin.x = (titleLabel?.frame.width)!+5
    }
}
